package PTA;

import java.util.Scanner;

class Media {
    double getDailyRent() {
        return 0;
    }
}
class Book11 extends Media {
    String name;
    double price;
    public Book11(String name, double price) {
        this.name = name;
        this.price = price;
    }

    double getDailyRent() {
        return price*0.01;
    }
}
class DVD extends Media {
    String name;

    public DVD(String name) {
        this.name = name;
    }

    double getDailyRent() {
        return 1.0;
    }
}
class MediaShop extends Media {
    static double calculateRent(Media[] medias, int days) {
        double sum = 0;
        for (int i = 0; i < medias.length; i++) {
            sum+=medias[i].getDailyRent()*days;
        }
        return sum;
    }
}
public class t11 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Media[] ms = new Media[n];
        for (int i = 0; i < n; i++) {
            String type = sc.next();
            if (type.equals("book")) {
                ms[i] = new Book11(sc.next(), sc.nextDouble());
            } else {
                ms[i] = new DVD(sc.next());
            }
        }
        double rent = MediaShop.calculateRent(ms, sc.nextInt());
        System.out.printf("%.2f", rent);
    }
}
